package com.company.clientscard.server.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

@Entity
@Table(name = "DOCUMENT")
public class Document extends BasicEntity {
	private String id1c;
	private Client client;
	private Date docDate;
	private String docNum;
	private String docType;
	private Long sum;
	private Date prinyat;
	private Date gotov;
	private Date vidan;

	public Document() {
	}

	public Document(String id1c, Client client, String docNum, String docType,
			Long sum) {
		super();
		this.id1c = id1c;
		this.client = client;
		this.docNum = docNum;
		this.docType = docType;
		this.sum = sum;
	}

	public Document(String id1c, Client client, Date docDate, String docNum,
			String docType, Long sum, Date prinyat, Date gotov, Date vidan) {
		super();
		this.id1c = id1c;
		this.client = client;
		this.docDate = docDate;
		this.docNum = docNum;
		this.docType = docType;
		this.sum = sum;
		this.prinyat = prinyat;
		this.gotov = gotov;
		this.vidan = vidan;
	}

	@Column(name = "ID_1c")
	public String getId1c() {
		return id1c;
	}

	public void setId1c(String id1c) {
		this.id1c = id1c;
	}

	@ManyToOne
	@JoinColumn(name = "CLIENT_ID", nullable = false, updatable = true)
	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@Column(name = "DOC_DATE")
	@Type(type = "date")
	public Date getDocDate() {
		return docDate;
	}

	public void setDocDate(Date docDate) {
		this.docDate = docDate;
	}

	@Column(name = "DOC_NUM")
	public String getDocNum() {
		return docNum;
	}

	public void setDocNum(String docNum) {
		this.docNum = docNum;
	}

	@Column(name = "DOC_TYPE")
	public String getDocType() {
		return docType;
	}

	public void setDocType(String docType) {
		this.docType = docType;
	}

	@Column(name = "SUM")
	public Long getSum() {
		return sum;
	}

	public void setSum(Long sum) {
		this.sum = sum;
	}

	@Column(name = "PRINYAT")
	@Type(type = "date")
	public Date getPrinyat() {
		return prinyat;
	}

	public void setPrinyat(Date prinyat) {
		this.prinyat = prinyat;
	}

	@Column(name = "GOTOV")
	@Type(type = "date")
	public Date getGotov() {
		return gotov;
	}

	public void setGotov(Date gotov) {
		this.gotov = gotov;
	}

	@Column(name = "VIDAN")
	@Type(type = "date")
	public Date getVidan() {
		return vidan;
	}

	public void setVidan(Date vidan) {
		this.vidan = vidan;
	}

}
